"The object to which this links refers has been purged"

Dear All,
I'm trying to link to many objects.
Some of these objects are deleted or they didn't exist.
The problem is that Doors keeps on displaying this alert
"The object to which this links refers has been purged"
when i'm linking to a null object.
i want to stop this warning or to make it a one warning which has
"OK TO ALL"
I think it is related to the implementation of the gotoObject method
Here is my code


Object source = gotoObject(requirmentId,srs_doc)// here you can link
if(null source){
print "Requirement ID :" reqId " is not found in Module : "module"\n"
}

else{
target->source //link to the source object
}

Thanks in advance :)
DXL - Tue Apr 20 06:56:43 EDT 2010

Re: "The object to which this links refers has been purged"
Mathias Mamsch - Tue Apr 20 08:42:45 EDT 2010

It seems that the error message in gotoObject is hardcoded and that you cannot get rid of it using noError(). You probably need to implement your own mechanism for locating the object. You can use object(nr) to find the object in addition to maybe searching for non displayed objects if you need it, in case object(...) does not find your object. Regards, Mathias

Re: "The object to which this links refers has been purged"
llandale - Tue Apr 20 15:08:09 EDT 2010

The Object object(int absno,Module m) command only finds displayed objects. I imagine that's the same for gotoObject() as well.

gotoObject suggests updating views and displaying the object, so I imagine it only really works for displayed modules.

These functions are inferior since they don't always work (they are dependant on the current display set). Write your own object searcher. You can put all the target objects in a Skip list (for oTarget in entire mTarget do) using int AbsNo as the key and Object as the Data, then search the Skip.

You seem to be getting this error when you attempt to create the link. Perhaps change that code to

noError
Link lnk = target -> source
string ErrMess = lastError()
if (null lnk or !null ErrMess)
{ deal with no link
}


Or perhaps link the Source TO the Target. Or perhaps use a specific link module.

I've had trouble with 'null' and frankly don't quite understand it completely. I suspect that you source is not 'null' enough for the 'if' statement, but is 'null' enough for the linking, where you are actually getting that error.

Or more likely (now that I think of it), perhaps the 'gotoObject' function is NOT finding the object and NOT updating the 'source' variable, which retains its non-null status from the previous loop using a different module now closed. 'source' is non-null but points to an object in a closed module ... confusing everybody and getting that 'purged' error.

Or maybe you lack read-rights to 'source', but gotoObject finds it anyway.

 

 

  • Louie


Avoid using known perms as identifiers, 'module' in this case. If nothing else its bad Karma for those who read it, and sometimes its bad Dogma for the code itself. Years ago I got myself in trouble calculating the length of a string using variable 'length'. Never figured it out, but the bug went away when I spelled it 'Length'.

 

 

Re: "The object to which this links refers has been purged"
DXL - Sun May 09 06:48:43 EDT 2010

Thanks for all the suggested solutions
I used as you suggested :
object(Module) instead of goToObject() and it worked and the pop-up disappeared :0)
What a simple solution :)

Million thanks,

Regards